The most basic ODE integrator object capable of integrating systems of ODE's.
Appends the supplied solution point to the internal solution buffer.
Appends the supplied solution point to the internal solution buffer.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(inout) | :: | this |
The ode_integrator object. |
||
real(kind=real64), | intent(in) | :: | x |
The independent variable value. |
||
real(kind=real64), | intent(in), | dimension(:) | :: | y |
The values of the dependent variables corresponding to x. |
|
class(errors), | intent(inout), | optional, | target | :: | err |
An optional errors-based object that if provided can be used to retrieve information relating to any errors encountered during execution. If not provided, a default implementation of the errors class is used internally to provide error handling. Possible errors and warning messages that may be encountered are as follows.
|
Clears the contents of the buffer.
Clears the contents of the buffer.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(inout) | :: | this |
The ode_integrator object. |
Computes the norm of the scaled error estimate.
Computes the norm of the scaled error estimate. A value less than one indicates a successful step. A value greater than one suggests that the results do not meet the requested tolerances.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(in) | :: | this |
The ode_integrator object. |
||
real(kind=real64), | intent(in), | dimension(:) | :: | y |
The previously accepted solution array (N-element). |
|
real(kind=real64), | intent(in), | dimension(size(y)) | :: | yest |
An N-element array containing the next solution point estimate. |
|
real(kind=real64), | intent(in), | dimension(size(y)) | :: | yerr |
An N-element array containing the estimate of error for each equation. |
The norm of the scaled error.
Computes an estimate of an initial step size.
Computes an estimate of an initial step size.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(in) | :: | this |
The ode_integrator object. |
||
class(ode_container), | intent(in) | :: | sys |
The ode_container object containing the ODE's to integrate. |
||
real(kind=real64), | intent(in) | :: | xo |
The initial value of the independent variable. |
||
real(kind=real64), | intent(in) | :: | xf |
The final value of the independent variable. |
||
real(kind=real64), | intent(in), | dimension(:) | :: | yo |
The initial values of the dependent variables (N-element). |
|
real(kind=real64), | intent(out), | dimension(size(yo)) | :: | fo |
An N-element array where the function values at xo will be written. |
|
real(kind=real64), | intent(out) | :: | h |
The initial step size estimate. |
Estimates the next step size.
Estimates the next step size based upon the current and previous error estimates.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(inout) | :: | this |
The ode_integrator object. |
||
real(kind=real64), | intent(in) | :: | e |
The norm of the current scaled error estimate. |
||
real(kind=real64), | intent(inout) | :: | eold |
The norm of the previous step's scaled error estimate. On output, this variable is updated. |
||
real(kind=real64), | intent(in) | :: | h |
The current step size. |
||
real(kind=real64), | intent(in) | :: | x |
The current independent variable value. |
||
class(errors), | intent(inout), | optional, | target | :: | err |
An optional errors-based object that if provided can be used to retrieve information relating to any errors encountered during execution. If not provided, a default implementation of the errors class is used internally to provide error handling. Possible errors and warning messages that may be encountered are as follows.
|
The new step size estimate.
Gets the absolute error tolerance.
Gets the absolute error tolerance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(in) | :: | this |
The ode_integrator object. |
The tolerance value.
Gets a value determining if the solver is allowed to overshoot the final value in the integration range.
Gets a value determining if the solver is allowed to overshoot the final value in the integration range.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(in) | :: | this |
The ode_integrator object. |
True if the solver can overshoot, and then interpolate to achieve the required final value; else, false thereby indicating the solver cannot overshoot.
Gets the magnitude of the maximum allowed step size.
Gets the magnitude of the maximum allowed step size.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(in) | :: | this |
The ode_integrator object. |
The step size limit.
Gets the magnitude of the minimum allowed step size.
Gets the magnitude of the minimum allowed step size.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(in) | :: | this |
The ode_integrator object. |
The step size limit.
Returns the order of the integrator.
Returns an integer value from the ode_integrator object.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(in) | :: | this |
The ode_integrator object. |
The requested value.
Gets the relative error tolerance.
Gets the absolute error tolerance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(in) | :: | this |
The ode_integrator object. |
The tolerance value.
Returns the solution computed by the integrator.
Returns the solution computed by the integrator stored as a matrix with the first column containing the values of the independent variable at which the solution was computed. The remaining columns contain the solutions for each of the integrated equations in the order in which they appear in the source routine. Notice, the solve routine must be called before this routine.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(in) | :: | this |
The ode_integrator object. |
The resulting solution matrix.
Gets the limit on the number of integration steps.
Gets the limit on the number of integration steps that may be taken before the solver terminates.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(in) | :: | this |
The ode_integrator object. |
The step limit.
Gets the step size PI control parameter.
Gets the step size control parameter β used for PI control of the step size. A value of 0 provides a default step size controller (non-PI); however, a nonzero value of β provides PI control that improves stability, but comes with a potential for efficiency loss. A good estimate for a starting point for this parameter is β=0.4k where k is the order of the integrator.
The PI controller for step size is defined as follows. hn+1=fshne−αneβn−1
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(in) | :: | this |
The ode_integrator object. |
The control parameter.
Gets the step size safety factor.
Gets the safety factor (step size multiplier) used to provide a measure of control to the step size estimate such that hnew=fsh, where fs is this safety factor.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(in) | :: | this |
The ode_integrator object. |
The safety factor.
Sets the absolute error tolerance.
Sets the absolute error tolerance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(inout) | :: | this |
The ode_integrator object. |
||
real(kind=real64), | intent(in) | :: | x |
The tolerance value. |
Sets a value determining if the solver is allowed to overshoot the final value in the integration range.
Sets a value determining if the solver is allowed to overshoot the final value in the integration range.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(inout) | :: | this |
The ode_integrator object. |
||
logical, | intent(in) | :: | x |
True if the solver can overshoot, and then interpolate to achieve the required final value; else, false thereby indicating the solver cannot overshoot. |
Sets the magnitude of the maximum allowed step size.
Sets the magnitude of the maximum allowed step size.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(inout) | :: | this |
The ode_integrator object. |
||
real(kind=real64), | intent(in) | :: | x |
The step size limit. |
Sets the magnitude of the minimum allowed step size.
Sets the magnitude of the minimum allowed step size.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(inout) | :: | this |
The ode_integrator object. |
||
real(kind=real64), | intent(in) | :: | x |
The step size limit. |
Sets the relative error tolerance.
Sets the absolute error tolerance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(inout) | :: | this |
The ode_integrator object. |
||
real(kind=real64), | intent(in) | :: | x |
The tolerance value. |
Sets the limit on the number of integration steps.
Sets the limit on the number of integration steps that may be taken before the solver terminates.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(inout) | :: | this |
The ode_integrator object. |
||
integer(kind=int32), | intent(in) | :: | x |
The step limit. |
Sets the step size PI control parameter.
Sets the step size control parameter β used for PI control of the step size. A value of 0 provides a default step size controller (non-PI); however, a nonzero value of β provides PI control that improves stability, but comes with a potential for efficiency loss. A good estimate for a starting point for this parameter is β=0.4k where k is the order of the integrator.
The PI controller for step size is defined as follows. hn+1=fshne−αneβn−1
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(inout) | :: | this |
The ode_integrator object. |
||
real(kind=real64), | intent(in) | :: | x |
The control parameter |
Sets the step size safety factor.
Sets the safety factor (step size multiplier) used to provide a measure of control to the step size estimate such that hnew=fsh, where fs is this safety factor.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(inout) | :: | this |
The ode_integrator object. |
||
real(kind=real64), | intent(in) | :: | x |
The safety factor. |
Solves the supplied system of ODE's.
Solves the supplied system of ODE's.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ode_integrator), | intent(inout) | :: | this |
The ode_integrator object. |
||
class(ode_container), | intent(inout) | :: | sys |
The ode_container object containing the ODE's to integrate. |
||
real(kind=real64), | intent(in), | dimension(:) | :: | x |
An array, of at least 2 values, defining at a minimum the starting and ending values of the independent variable integration range. If more than two values are specified, the integration results will be returned at the supplied values. |
|
real(kind=real64), | intent(in), | dimension(:) | :: | iv |
An array containing the initial values for each ODE. |
|
class(errors), | intent(inout), | optional, | target | :: | err |
An optional errors-based object that if provided can be used to retrieve information relating to any errors encountered during execution. If not provided, a default implementation of the errors class is used internally to provide error handling. Possible errors and warning messages that may be encountered are as follows.
|